home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
X User Tools
/
X User Tools (O'Reilly and Associates)(1994).ISO
/
sun4c
/
archive
/
tcltk.z
/
tcltk
/
man
/
cat3
/
ConfigWind.3
< prev
next >
Wrap
Text File
|
1994-09-20
|
13KB
|
331 lines
Tk_ConfigureWindow(3) Tk Library Procedures 3.3
_________________________________________________________________
NAME
Tk_ConfigureWindow, Tk_MoveWindow, Tk_ResizeWindow,
Tk_MoveResizeWindow, Tk_SetWindowBorderWidth
Tk_ChangeWindowAttributes, Tk_SetWindowBackground,
Tk_SetWindowBackgroundPixmap, Tk_SetWindowBorder,
Tk_SetWindowBorderPixmap, Tk_SetWindowColormap,
Tk_DefineCursor, Tk_UndefineCursor - change window confi-
guration or attributes
SYNOPSIS
#include <tk.h>
Tk_ConfigureWindow(_t_k_w_i_n, _v_a_l_u_e_M_a_s_k, _v_a_l_u_e_P_t_r)
Tk_MoveWindow(_t_k_w_i_n, _x, _y)
Tk_ResizeWindow(_t_k_w_i_n, _w_i_d_t_h, _h_e_i_g_h_t)
Tk_MoveResizeWindow(_t_k_w_i_n, _x, _y, _w_i_d_t_h, _h_e_i_g_h_t)
Tk_SetWindowBorderWidth(_t_k_w_i_n, _b_o_r_d_e_r_W_i_d_t_h)
Tk_ChangeWindowAttributes(_t_k_w_i_n, _v_a_l_u_e_M_a_s_k, _a_t_t_s_P_t_r)
Tk_SetWindowBackground(_t_k_w_i_n, _p_i_x_e_l)
Tk_SetWindowBackgroundPixmap(_t_k_w_i_n, _p_i_x_m_a_p)
Tk_SetWindowBorder(_t_k_w_i_n, _p_i_x_e_l)
Tk_SetWindowBorderPixmap(_t_k_w_i_n, _p_i_x_m_a_p)
Tk_SetWindowColormap(_t_k_w_i_n, _c_o_l_o_r_m_a_p) |
Tk_DefineCursor(_t_k_w_i_n, _c_u_r_s_o_r) |
Tk_UndefineCursor(_t_k_w_i_n) |
ARGUMENTS
Tk_Window _t_k_w_i_n (in) Token for
window.
unsigned int _v_a_l_u_e_M_a_s_k (in) OR-ed mask of
values like
CWX or CWBor-
derPixel,
indicating
which fields
of *_v_a_l_u_e_P_t_r
or *_a_t_t_s_P_t_r
Tk 1
Tk_ConfigureWindow(3) Tk Library Procedures 3.3
to use.
XWindowChanges *_v_a_l_u_e_P_t_r (in) Points to a
structure
containing
new values
for the con-
figuration
parameters
selected by
_v_a_l_u_e_M_a_s_k.
Fields not
selected by
_v_a_l_u_e_M_a_s_k are
ignored.
int _x (in) New x-
coordinate
for _t_k_w_i_n's
top left
pixel
(including
border, if
any) within
tkwin's
parent.
int _y (in) New y-
coordinate
for _t_k_w_i_n's
top left
pixel
(including
border, if
any) within
tkwin's
parent.
unsigned int _w_i_d_t_h (in) New width for
_t_k_w_i_n (inte-
rior, not
including
border).
unsigned int _h_e_i_g_h_t (in) New height
for _t_k_w_i_n
(interior,
not including
border).
unsigned int _b_o_r_d_e_r_W_i_d_t_h (in) New width for
_t_k_w_i_n's
Tk 2
Tk_ConfigureWindow(3) Tk Library Procedures 3.3
border.
XSetWindowAttributes *_a_t_t_s_P_t_r (in) Points to a
structure
containing
new values
for the
attributes
given by the
_v_a_l_u_e_M_a_s_k
argument.
Attributes
not selected
by _v_a_l_u_e_M_a_s_k
are ignored.
unsigned long _p_i_x_e_l (in) New back-
ground or
border color
for window.
Pixmap _p_i_x_m_a_p (in) New pixmap to
use for back-
ground or
border of
_t_k_w_i_n. WARN-
ING: cannot
necessarily
be deleted
immediately,
as for Xlib
calls. See
note below.
Colormap _c_o_l_o_r_m_a_p (in) New colormap |
to use for |
_t_k_w_i_n. |
Cursor _c_u_r_s_o_r (in) ||
New cursor to |
use for |
_t_k_w_i_n. If |
None is |
specified, |
then _t_k_w_i_n |
will not have |
its own cur- |
sor; it will |
use the cur- |
sor of its |
parent.
_________________________________________________________________
Tk 3
Tk_ConfigureWindow(3) Tk Library Procedures 3.3
DESCRIPTION
These procedures are analogous to the X library procedures
with similar names, such as XConfigureWindow. Each one of
the above procedures calls the corresponding X procedure and
also saves the configuration information in Tk's local
structure for the window. This allows the information to be
retrieved quickly by the application (using macros such as
Tk_X and Tk_Height) without having to contact the X server.
In addition, if no X window has actually been created for
_t_k_w_i_n yet, these procedures do not issue X operations or
cause event handlers to be invoked; they save the informa-
tion in Tk's local structure for the window; when the win-
dow is created later, the saved information will be used to
configure the window.
See the X library documentation for details on what these
procedures do and how they use their arguments.
In the procedures Tk_ConfigureWindow, Tk_MoveWindow,
Tk_ResizeWindow, Tk_MoveResizeWindow, and
Tk_SetWindowBorderWidth, if _t_k_w_i_n is an internal window then
event handlers interested in configure events are invoked
immediately, before the procedure returns. If _t_k_w_i_n isn't a
top-level window then the event handlers will be invoked
later, after X has seen the request and returned an event
for it.
Applications using Tk should never call procedures like
XConfigureWindow directly; they should always use the
corresponding Tk procedures.
The size and location of a window should only be modified by |
the appropriate geometry manager for that window and never |
by a window itself (but see Tk_MoveToplevelWindow for moving |
a top-level window).
It is not allowable to use Tk_ConfigureWindow to change the |
stacking order of a window (_v_a_l_u_e_M_a_s_k may not contain the |
CWSibling or CWStackMode bits). To change the stacking |
order, use the procedure Tk_RestackWindow.
BUGS
Tk_SetWindowBackgroundPixmap and Tk_SetWindowBorderPixmap
differ slightly from their Xlib counterparts in that the
_p_i_x_m_a_p argument may not necessarily be deleted immediately
after calling one of these procedures. This is because
_t_k_w_i_n's window may not exist yet at the time of the call, in
which case _p_i_x_m_a_p is merely saved and used later when
_t_k_w_i_n's window is actually created. If you wish to delete
_p_i_x_m_a_p, then call Tk_MakeWindowExist first to be sure that
_t_k_w_i_n's window exists and _p_i_x_m_a_p has been passed to the X
Tk 4
Tk_ConfigureWindow(3) Tk Library Procedures 3.3
server.
A similar problem occurs for the _c_u_r_s_o_r argument passed to |
Tk_DefineCursor. The solution is the same as for pixmaps |
above: call Tk_MakeWindowExist before freeing the cursor.
SEE ALSO
Tk_MoveToplevelWindow, Tk_RestackWindow
KEYWORDS
attributes, border, color, configure, height, pixel, pixmap,
width, window, x, y
Tk 5